package com.kris.dev3.SingleModel;

/**
 * 单例模式
 *
 * 线程安全 并且效率高
 *
 */
public class SingleClass {

    private static SingleClass singleClass;

    public static SingleClass getInstance() {
        if (singleClass == null) {
            synchronized(SingleClass.class){
                singleClass = new SingleClass();
            }
        }
        return singleClass;
    }

}
